import request from '@/utils/request'

// 小区下拉框

export const getCommunity = () => request({
  method: 'GET',
  url: '/community'
})

// 获取表单数据
export const getComponents = params => request({
  method: 'GET',
  url: '/device/index',
  params
})

// 删除
export const delComponents = id => request({
  method: 'DELETE',
  url: `device/index/${id}`
})
// 新增
export const postComponents = data => request({
  method: 'POST',
  url: 'device/index',
  data
})
// 详情
export const editComponents = id => request({
  method: 'GET',
  url: `device/index/${id}`
})
// 编辑
export const PUTComponents = data => request({
  method: 'PUT',
  url: `device/index/${data.id}`,
  data
})
// 图片上传
export const Upimage = data => request({
  method: 'POST',
  url: `base/upload?field=device`,
  data
})
